package com.my.admin.service.impl;

import com.my.admin.entity.Menu;
import com.my.admin.entity.Role;
import com.my.admin.mapper.RoleMapper;
import com.my.admin.service.RoleService;
import com.my.admin.util.ServiceImplCache;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author my
 */
@Service
public class RoleServiceImpl extends ServiceImplCache<RoleMapper, Role> implements RoleService {

    @Override
    @Cacheable(value = "roleListByUserId")
    public List<Long> roleListByUserId(long userId) {
        return baseMapper.roleListByUserId(userId);
    }

    @Override
    @Cacheable(value = "menuListByRoleId")
    public List<Menu> menuListByRoleId(long roleId) {
        return baseMapper.menuListByRoleId(roleId);
    }

}
